<template>
  <div class="pics">
    <div class="pic" v-for="item in props.list">
      <slot>
        <div class="img">
          <img :src="item.url" alt="" />
          <div class="bigscale" @click="openDialog(item)"></div>
        </div>
        <div class="text">{{ item.name }}</div>
      </slot>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  required: {
    type: Boolean,
    required: false,
  },
  width: {
    type: String,
    default: "",
  },
  padding: {
    type: String,
    default: "",
  },
  title: {
    type: String,
    default: "",
  },
  list: {
    type: Array,
    default: [],
  },
});

</script>

<style scoped lang="scss">
.contact {
  background-color: #fff;
  padding: 40px;
  transition: all 0.5s ease-in-out;
}
.contact:hover {
  /* x 偏移量 | y 偏移量 | 阴影模糊半径 | 阴影扩散半径 | 阴影颜色 */
  box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}
.pics {
  width: 100%;
  overflow-x: auto;
  white-space: nowrap; /* 防止子元素换行 */
  margin-top: 30px;
  .pic {
    display: inline-block;
    margin-left: 20px;
    .img {
      position: relative;
      width: 290px;
      height: 290px;
      background: linear-gradient(to top, #fefefe, #f2f4f8);

      border-radius: 5px;
      white-space: nowrap;
      display: flex;
      justify-content: center;
      align-items: center;
      > img {
        width: 160px;
        height: 226px;
        //object-fit: cover;
      }
      .bigscale {
        position: absolute;
        right: 16px;
        bottom: 30px;
        width: 24px;
        height: 24px;
        background: url("@/assets/images/bigscale.png") no-repeat;
      }
    }

    .text {
      font-size: 16px;
      text-align: center;
      color: #222;
      margin-top: 20px;
    }
  }
  .pic:first-child {
    margin-left: 0;
  }
}
</style>
